Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vim snippet to the README.rst #6

Merged
merged 4 commits into from
Apr 26, 2020

Conversation

smbl64
Copy link
Contributor

@smbl64 smbl64 commented Apr 26, 2020

This PR adds a vimscript snippet to the README file.

This snippet works on the current line in the "normal" mode, and on the selected lines in the "visual" mode.

Copy link
Owner

@wbolster wbolster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looks good. left a few comments/questions.

that said, as an avid emacs user, i can only say that vim script looks, eh, special. 🙃

vim_snippet.vim Outdated
function! s:RunBlackMacchiato(visual) range
let cmd = "black-macchiato"
if !executable(cmd)
echo "black-macchiato not found!"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm, vim does not have an error reporting function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I will use a different approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

vim_snippet.vim Outdated
@@ -0,0 +1,25 @@
function! s:RunBlackMacchiato(visual) range
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this also be run from the : command prompt?

if so, maybe BlackMacchiato is a more discoverable name?

if not, a :BlackMacchiato command (it has tab completion i hope) that behaves the same as this function would be useful, and simpler to use in case users don't want to make a dedicated key binding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the function cannot be called as a command. For this to also work as a command, I will need to rewrite the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to learn how to do it 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@wbolster wbolster merged commit 7348594 into wbolster:master Apr 26, 2020
@wbolster
Copy link
Owner

thanks, merged! 🚀

@smbl64 smbl64 deleted the add-vim-snippet branch April 26, 2020 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants